package cn.edu.jxau.framework.dao.core;

import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.List;

import org.dom4j.DocumentException;




public class sqlSessionFactory {
	
	private int i=0;
	
	private static class singketonFactory{
		private static sqlSessionFactory sessionFactory = new sqlSessionFactory();
	}
	
	public static sqlSessionFactory getInstance(){
		sqlSessionFactory sessionFactory = singketonFactory.sessionFactory;
		return sessionFactory;
	}
	
	/**
	 * 返回session
	 * @return
	 * @throws ClassNotFoundException
	 * @throws DocumentException
	 */
	public Session getSession() throws ClassNotFoundException, DocumentException{
		return new Session(initLocalCacheId());
	}
	

	
	/**
	 * 创建缓存id
	 * @return
	 */
	private String initLocalCacheId(){
		i++;
		return "session"+i;
	}
}
